package com.zl.quickdoc.model;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.javaparser.ast.body.MethodDeclaration;
import com.zl.quickdoc.resolver.converter.AbstractJavaDocTag;

/**
 * @author zhouliang
 */
public class ApiAction {
    /**
     * 方法
     */
    @JsonIgnore
    private MethodDeclaration methodDeclaration;
    
    /**
     * 注释标签
     */
    @JsonIgnore
    private List<AbstractJavaDocTag<?>> docTags;
    
    /**
     * 隐藏
     */
    private boolean hiddenFlag=false;
    
    /**
     * 方法返回类型
     */
    private String returnTypeStr;
    
    /**
     * 方法入参类型
     */
    private String paramTypeStr;
    
    /**
     * 接口方法名称
     */
    private String name;
    /**
     * 接口方法名称
     */
    private String simpleName;
    
    /**
     * 标题
     */
    private String title;
    
    /**
     * 描述
     */
    private String description;
    
    /**
     * 排序
     */
    private int orderBy=0;
    
    /**
     * 访问的uri地址
     */
    private List<String> uris;

    /**
     * 允许的访问方法:POST,GET,DELETE,PUT等, 如果没有,则无限制
     */
    private List<String> methods;

    /**
     * 入参
     */
    private List<ApiField> reqParam = new ArrayList<>(0);

    /**
     * 出参
     */
    private List<ApiField> resParam;

    /**
     * 返回描述
     */
    private String returnDesc;

    /**
     * 返回的数据
     */
    private String respbody;
    
    /**
     * 请求类型
     */
    private String contentType;
    
    /**
     * 返回json/下载流/void
     */
    private String dataType;
    
    /**
     * 请求例子
     */
    private String requestValue;
    private String requestValueSimple;

    /**
     * 返回例子
     */
    private String responseValue;
    private String responseValueSimple;
    
    /** 是否有参数*/
    private boolean requestVoid=false;
    private boolean responseVoid=false;
    
    /** 是否集合*/
    private boolean requestListFlag=false;
    private boolean responseListFlag=false;
    /** 是否json*/
    private boolean requestJsonFlag=false;
    private boolean responseJsonFlag=false;
    
    /**json请求java格式 */
    private String requestJsonJava;
    
    private List<ApiField> pathParam = new ArrayList<>(0);

    public MethodDeclaration getMethodDeclaration() {
        return methodDeclaration;
    }

    public void setMethodDeclaration(MethodDeclaration method) {
        this.methodDeclaration = method;
    }

    public List<AbstractJavaDocTag<?>> getDocTags() {
        return docTags;
    }

    public void setDocTags(List<AbstractJavaDocTag<?>> docTags) {
        this.docTags = docTags;
    }

    public boolean getHiddenFlag() {
        return hiddenFlag;
    }

    public void setHiddenFlag(boolean hiddenFlag) {
        this.hiddenFlag = hiddenFlag;
    }

    public String getReturnTypeStr() {
        return returnTypeStr;
    }

    public void setReturnTypeStr(String returnType) {
        this.returnTypeStr = returnType;
    }

    public String getParamTypeStr() {
        return paramTypeStr;
    }

    public void setParamTypeStr(String paramType) {
        this.paramTypeStr = paramType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSimpleName() {
        return simpleName;
    }

    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(int orderBy) {
        this.orderBy = orderBy;
    }
    
    public List<String> getUris() {
        return uris;
    }
    public void setUris(List<String> uris) {
        this.uris = uris;
    }
    public List<String> getMethods() {
        return methods;
    }
    public void setMethods(List<String> methods) {
        this.methods = methods;
    }
    public List<ApiField> getReqParam() {
        return reqParam;
    }
    public void setReqParam(List<ApiField> reqParam) {
        this.reqParam = reqParam;
    }
    public List<ApiField> getResParam() {
        return resParam;
    }
    public void setResParam(List<ApiField> resParam) {
        this.resParam = resParam;
    }
    public String getReturnDesc() {
        return returnDesc;
    }
    public void setReturnDesc(String returnDesc) {
        this.returnDesc = returnDesc;
    }
    public String getRespbody() {
        return respbody;
    }
    public void setRespbody(String respbody) {
        this.respbody = respbody;
    }
    public String getContentType() {
        return contentType;
    }
    public void setContentType(String contentType) {
        this.contentType = contentType;
    }
    public String getDataType() {
        return dataType;
    }
    public void setDataType(String dataType) {
        this.dataType = dataType;
    }
    public String getRequestValue() {
        return requestValue;
    }
    public void setRequestValue(String requestValue) {
        this.requestValue = requestValue;
    }
    public String getResponseValue() {
        return responseValue;
    }
    public void setResponseValue(String responseValue) {
        this.responseValue = responseValue;
    }
    public boolean getRequestVoid() {
        return requestVoid;
    }
    public void setRequestVoid(boolean requestVoid) {
        this.requestVoid = requestVoid;
    }
    public boolean getResponseVoid() {
        return responseVoid;
    }
    public void setResponseVoid(boolean responseVoid) {
        this.responseVoid = responseVoid;
    }
    public boolean getRequestListFlag() {
        return requestListFlag;
    }
    public void setRequestListFlag(boolean requestListFlag) {
        this.requestListFlag = requestListFlag;
    }
    public boolean getResponseListFlag() {
        return responseListFlag;
    }
    public void setResponseListFlag(boolean responseListFlag) {
        this.responseListFlag = responseListFlag;
    }
    public String getRequestValueSimple() {
        return requestValueSimple;
    }
    public void setRequestValueSimple(String requestValueSimple) {
        this.requestValueSimple = requestValueSimple;
    }
    public String getResponseValueSimple() {
        return responseValueSimple;
    }
    public void setResponseValueSimple(String responseValueSimple) {
        this.responseValueSimple = responseValueSimple;
    }
    public boolean getRequestJsonFlag() {
        return requestJsonFlag;
    }
    public void setRequestJsonFlag(boolean requestJson) {
        this.requestJsonFlag = requestJson;
    }
    public boolean getResponseJsonFlag() {
        return responseJsonFlag;
    }
    public void setResponseJsonFlag(boolean responseJson) {
        this.responseJsonFlag = responseJson;
    }
    public String getRequestJsonJava() {
        return requestJsonJava;
    }
    public void setRequestJsonJava(String requestJsonJava) {
        this.requestJsonJava = requestJsonJava;
    }
    public List<ApiField> getPathParam() {
        return pathParam;
    }
    public void setPathParam(List<ApiField> pathParam) {
        this.pathParam = pathParam;
    }
}
